﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler;
using Module_Persistence;
using Module_Basic_Entities;

namespace ContentPipelineExtension_MapFromMappy
{
    class ListCustomContentTypeWriter : ContentTypeWriter
    {
        public ListCustomContentTypeWriter(Type targetType)
            : base(targetType)
        {
            
        }
        protected override void Write(ContentWriter output, object value)
        {
            List<Tile> tiles = (List<Tile>)value;

            foreach (Tile t in tiles)
            {
                output.WriteObject<Tile>(t, new TileCustomContentTypeWriter(typeof(Tile)));
            }
        }

        public override string GetRuntimeReader(Microsoft.Xna.Framework.TargetPlatform targetPlatform)
        {
            return "System.Collections.Generic.List<T>, System";
        }
    }
}
